/**
 * 
 */
package fhq.hcmute.edu.vn.system;

import java.util.ArrayList;

/**
 * @author Hien Nguyen Oct 30, 2012
 */
public class MyFolder extends MySystem {

	private static final long serialVersionUID = -9113607990843500698L;
	private ArrayList<MySystem> folders;
	private boolean isRoot;

	public MyFolder() {
		folders = new ArrayList<MySystem>();
		this.fileType = FileType.folder;
		this.iconUrl = fileType.getValue();
	}

	public MyFolder(MyFolder folder) {
		folders = folder.folders;
		this.fileType = FileType.folder;
		this.iconUrl = folder.fileType.getValue();
	}

	public ArrayList<MySystem> getFolders() {
		return folders;
	}

	public void setFolders(ArrayList<MySystem> folders) {
		this.folders = folders;
	}

	public boolean isRoot() {
		return isRoot;
	}

	public void setRoot(boolean isRoot) {
		this.isRoot = isRoot;
	}

	@Override
	public void add(MySystem myDisk) {
		this.folders.add(myDisk);
	}

	public MyFolder(String name, String path) {
		folders = new ArrayList<MySystem>();
		this.name = name;
		this.path = path;
		this.isHidden = false;
		this.isRoot = false;
		this.fileType = FileType.folder;
		this.iconUrl = fileType.getValue();
	}

	public MyFolder(String name, String path, boolean isHidden) {
		folders = new ArrayList<MySystem>();
		this.name = name;
		this.path = path;
		this.isHidden = isHidden;
		this.isRoot = false;
		this.fileType = FileType.folder;
		this.iconUrl = fileType.getValue();
	}

	public MyFolder(String name, String path, boolean isHidden, boolean isRoot) {
		folders = new ArrayList<MySystem>();
		this.name = name;
		this.path = path;
		this.isHidden = isHidden;
		this.isRoot = isRoot;
		this.fileType = FileType.folder;
		this.iconUrl = fileType.getValue();
	}
}
